//
//  OKDoctorInfoController.m
//  ZLFastDoctor
//
//  Created by answer on 16/5/23.
//  Copyright © 2016年 LS. All rights reserved.
//

#import "OKDoctorInfoController.h"
#import "LSAPIManager.h"
#import "OKDoctorInfoModel.h"
#import "OKSickModel.h"
#import <SVProgressHUD.h>
#import <Masonry/Masonry.h>

#import "LSHTTPManager.h"
#import "OKDoctorInfor.h"
#import "OKDoctorInfoBottomView.h"
#import "OKSickCaseController.h"


@interface OKDoctorInfoController () <OKDoctorInfoBottomViewDelegate>
//基本信息显示的View
@property (strong, nonatomic) OKDoctorInfor *topView;
@property (strong, nonatomic) OKDoctorInfoBottomView *bottomView;

@end

@implementation OKDoctorInfoController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:1.0];
    //页面信息
    self.navigationItem.title = @"医生基本信息";
    //请求数据
    [self reloadData];
}

//加载数据
- (void)reloadData {
    
    NSDictionary *parameters = @{@"user_id":@1000089,@"doctor_id":@30000020};
    
    [OKSickModel requestDoctorInfoWithParams:parameters completion:^(OKDoctorInfoModel *model) {
        
        self.topView.model = model;
        [self setupUI];
        //[self setupInfoView];
    }];

}

- (void)setupUI {
    [self.view addSubview:self.topView];
    [self.view addSubview:self.bottomView];
    self.bottomView.data = self.data;
    self.bottomView.delegate = self;
    
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(self.view);

    }];
    
    [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view);
        make.top.equalTo(self.topView.mas_bottom).offset(10);
    }];
}

- (void)doctorInfoBottomViewCallBack {
    OKSickCaseController *vc = [[OKSickCaseController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (OKDoctorInfor *)topView {
    if (_topView == nil) {
        _topView = [[OKDoctorInfor alloc] init];
        _topView.backgroundColor = [UIColor whiteColor];
    }
    return _topView;
}

- (OKDoctorInfoBottomView *)bottomView {
    if (_bottomView == nil) {
        _bottomView = [OKDoctorInfoBottomView bottomView];
    }
    return _bottomView;
}


@end




